<?php

declare(strict_types=1);
/**
 * This file is part of Hyperf.
 *
 * @link     https://www.hyperf.io
 * @document https://hyperf.wiki
 * @contact  group@hyperf.io
 * @license  https://github.com/hyperf/hyperf/blob/master/LICENSE
 */
use Hyperf\Database\Migrations\Migration;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Schema\Schema;

class UpdateA05ConfigTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('hosts', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('identifier', 64)->unique()->comment('托管者标识');
            $table->string('version', 10)->default('2.1.2')->comment('软件版本');
            $table->string('status', 20)->default('运行中')->comment('运行状态');
            $table->string('use_status', 20)->default('使用中')->comment('使用状态');
            $table->tinyInteger('cpu')->default(2)->comment('CPU核心数');
            $table->tinyInteger('memory')->default(2)->comment('内存(GB)');
            $table->string('region', 20)->nullable()->comment('所在地区');
            $table->string('price', 20)->default('$30.00')->comment('资费(月)');
            $table->dateTime('expired_at')->nullable()->comment('到期时间');
            $table->dateTime('deployed_at')->nullable()->comment('部署时间');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('hosts', function (Blueprint $table) {});
    }
}
